package com.zxl.jdk8test;

import java.util.function.Consumer;

/**
 * 消费型接口
 * Consumer 接口表示执行在单个参数上的操作。 
 * @author zxl
 *
 */
public class ConsumerTest {
    
    public static void main(String[] args) {
        Consumer<Person> consumer = (final Person person) -> System.out.println(person.getAge());
        //实际调用System.out.println(person.getAge())
        consumer.accept(new Person("小亮",22));
    }
}
